from cgi import test
import requests
import os
import yaml

def test_object(file_path):
    with open(file_path,"r",encoding="utf-8") as f:
        test_data=yaml.load(f.read(),Loader=yaml.FullLoader)
        # print(test_data,"\n")        
        # print(test_data["tests"],"\n")
        case=test_data["tests"][0]["case"]
        http=test_data["tests"][0]["http"]
        expected=test_data["tests"][0]["expected"]
    return case,http,expected


file_path=os.path.dirname(__file__)+"\\test.yaml"
case,http,expected=test_object(file_path)

class Test_class(object):
    def test_01(self):
        host="http://api.douban.com"
        print(http["method"],http["path"])
        # r=requests.request(method=http["method"],url=host+http["path"],params=http["params"],headers=http["headers"])
        # print(r)

a=Test_class()
a.test_01()